#include<bits/stdc++.h>
using namespace std;
int n,i,j,sum;
int a[1000];
int main()
{
   freopen("duel.in","r",stdin);
   freopen("duel.out","w",stdout);
   cin>>n;
   sum=0;
   for(int i=0;i<=n;i++)
      cin>>a[i];
    if(n<=5)
      for(int i=0;i<=n;i++)
   {
       for(int j=1;j<=n;j++)
       {
           if(a[j]<=a[j-1]) sum=n-3;
           else sum++;
       }
    }
    else
        for(int i=0;i<=n;i++)
   {
       for(int j=1;j<=n;j++)
       {
           if(a[j]<=a[j-1]) sum=n-2;
           else sum++;
       }
    }
   cout<<sum;
   return 0;
}
